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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.p: E = None
        self.w: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: A = None
        self.o: D = None
        self.w: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.p: E = None
        self.w: C = None
        self.u: E = None
        self.txt = txt

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

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

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

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