class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

b.p = l
b.y = l
c.r = l
c.p = h
c.w = h
e.s = j
e.q = b
e.t = n
e.v = n
e.r = l
e.x = d
n.s = h
n.t = h
j.q = h
j.r = h
j.u = e
k.s = j
k.x = l
k.w = n
k.z = n
l.p = b
l.y = b
h.r = l
h.p = c
h.w = c
d.s = j
d.x = b
d.w = n
d.z = n
assert k.s.u.q.y.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

b.p = l
b.y = l
c.r = l
c.p = h
c.w = h
e.s = j
e.q = b
e.t = n
e.v = n
e.r = l
e.x = d
n.s = h
n.t = h
j.q = h
j.r = h
j.u = e
k.s = j
k.x = l
k.w = n
k.z = n
l.p = b
l.y = b
h.r = l
h.p = c
h.w = c
d.s = j
d.x = b
d.w = n
d.z = n
assert k.s.u.q.y.p.p.p.txt == "b"