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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

l = A("l")
d = B("d")
a = C("a")
j = D("j")
h = E("h")
c = F("c")
e = G("e")
n = C("n")
g = D("g")
b = A("b")

l.x = n
l.y = b
d.w = n
a.t = c
a.q = d
a.p = l
a.o = l
a.w = l
a.y = h
a.x = e
j.o = b
h.v = g
h.z = d
c.x = d
c.z = d
c.w = e
c.u = n
c.v = h
e.w = h
n.t = c
n.q = d
n.p = b
n.o = l
n.w = l
n.y = h
n.x = e
g.o = l
b.x = n
b.y = l
assert e.w.v.o.y.y.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

l = A("l")
d = B("d")
a = C("a")
j = D("j")
h = E("h")
c = F("c")
e = G("e")
n = C("n")
g = D("g")
b = A("b")

l.x = n
l.y = b
d.w = n
a.t = c
a.q = d
a.p = l
a.o = l
a.w = l
a.y = h
a.x = e
j.o = b
h.v = g
h.z = d
c.x = d
c.z = d
c.w = e
c.u = n
c.v = h
e.w = h
n.t = c
n.q = d
n.p = b
n.o = l
n.w = l
n.y = h
n.x = e
g.o = l
b.x = n
b.y = l
assert e.w.v.o.y.y.y.x.txt == "n"