class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.q: F = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: D = None
        self.u: A = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.q: B = None
        self.o: D = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

f = A("f")
m = B("m")
a = C("a")
c = D("c")
i = E("i")
j = F("j")
n = G("n")

f.t = c
m.t = i
m.u = n
m.q = j
m.w = j
m.v = a
a.y = m
c.t = j
c.q = f
i.y = c
i.q = c
i.w = c
i.t = c
i.u = f
i.r = f
j.w = f
j.x = i
j.q = m
j.o = c
j.p = a
n.x = m
n.t = m
n.v = i
n.q = c
assert a.y.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: G = None
        self.q: F = None
        self.v: C = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.w: D = None
        self.u: A = None
        self.t: D = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: E = None
        self.q: B = None
        self.o: D = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: E = None
        self.t: B = None
        self.q: D = None
        self.txt = txt

f = A("f")
m = B("m")
a = C("a")
c = D("c")
i = E("i")
j = F("j")
n = G("n")

f.t = c
m.t = i
m.u = n
m.q = j
m.w = j
m.v = a
a.y = m
c.t = j
c.q = f
i.y = c
i.q = c
i.w = c
i.t = c
i.u = f
i.r = f
j.w = f
j.x = i
j.q = m
j.o = c
j.p = a
n.x = m
n.t = m
n.v = i
n.q = c
assert a.y.t.r.txt == "f"