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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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