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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.u: F = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.t: A = None
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

c = A("c")
e = B("e")
m = C("m")
b = D("b")
d = E("d")
h = F("h")
i = D("i")

c.p = d
c.q = d
c.u = e
c.r = h
c.t = h
c.w = m
e.z = d
e.y = m
m.z = b
m.q = h
m.u = h
m.s = c
m.r = d
b.v = e
b.q = e
d.x = h
d.s = h
d.t = c
d.q = c
d.u = e
d.r = m
h.y = m
h.t = m
h.u = e
h.x = c
i.v = e
i.q = e
assert i.v.y.s.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: B = None
        self.r: F = None
        self.q: E = None
        self.w: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: F = None
        self.u: F = None
        self.s: A = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: F = None
        self.t: A = None
        self.u: B = None
        self.q: A = None
        self.r: C = None
        self.txt = txt

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

c = A("c")
e = B("e")
m = C("m")
b = D("b")
d = E("d")
h = F("h")
i = D("i")

c.p = d
c.q = d
c.u = e
c.r = h
c.t = h
c.w = m
e.z = d
e.y = m
m.z = b
m.q = h
m.u = h
m.s = c
m.r = d
b.v = e
b.q = e
d.x = h
d.s = h
d.t = c
d.q = c
d.u = e
d.r = m
h.y = m
h.t = m
h.u = e
h.x = c
i.v = e
i.q = e
assert i.v.y.s.p.x.txt == "h"