class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.u: D = None
        self.y: G = None
        self.t: A = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.u: D = None
        self.z: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: C = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.t: C = None
        self.txt = txt

f = A("f")
h = B("h")
d = C("d")
c = D("c")
j = E("j")
b = F("b")
e = G("e")
k = B("k")
n = A("n")

f.z = n
f.t = n
f.p = n
f.q = c
f.u = c
f.y = e
h.s = c
h.u = c
h.z = c
h.r = e
h.y = e
d.q = n
c.o = b
j.w = c
j.r = n
b.t = j
b.x = j
b.q = d
e.z = d
e.y = d
e.t = d
k.s = c
k.u = c
k.z = c
k.r = e
k.y = e
n.z = f
n.t = f
n.p = f
n.q = c
n.u = c
n.y = e
assert d.q.t.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.u: D = None
        self.y: G = None
        self.t: A = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: G = None
        self.u: D = None
        self.z: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: C = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: C = None
        self.t: C = None
        self.txt = txt

f = A("f")
h = B("h")
d = C("d")
c = D("c")
j = E("j")
b = F("b")
e = G("e")
k = B("k")
n = A("n")

f.z = n
f.t = n
f.p = n
f.q = c
f.u = c
f.y = e
h.s = c
h.u = c
h.z = c
h.r = e
h.y = e
d.q = n
c.o = b
j.w = c
j.r = n
b.t = j
b.x = j
b.q = d
e.z = d
e.y = d
e.t = d
k.s = c
k.u = c
k.z = c
k.r = e
k.y = e
n.z = f
n.t = f
n.p = f
n.q = c
n.u = c
n.y = e
assert d.q.t.t.y.txt == "e"