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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: E = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: F = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: E = None
        self.y: A = None
        self.p: B = None
        self.txt = txt

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

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

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

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