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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.u: A = None
        self.z: F = None
        self.p: F = None
        self.r: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

j.u = b
j.t = a
f.r = m
f.x = j
b.w = a
b.x = a
b.z = a
b.p = a
b.u = j
b.r = m
c.p = e
c.u = b
e.z = j
e.u = j
a.z = c
a.x = b
a.s = j
m.w = a
m.x = a
m.z = a
m.p = a
m.u = i
m.r = b
i.u = b
i.t = a
assert b.x.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.x: F = None
        self.u: A = None
        self.z: F = None
        self.p: F = None
        self.r: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

j.u = b
j.t = a
f.r = m
f.x = j
b.w = a
b.x = a
b.z = a
b.p = a
b.u = j
b.r = m
c.p = e
c.u = b
e.z = j
e.u = j
a.z = c
a.x = b
a.s = j
m.w = a
m.x = a
m.z = a
m.p = a
m.u = i
m.r = b
i.u = b
i.t = a
assert b.x.z.p.txt == "e"