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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.txt = txt

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

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

c.z = b
c.p = j
f.t = j
f.y = j
f.q = n
f.o = b
f.w = e
b.z = e
l.u = e
l.z = c
l.x = j
n.v = j
n.w = g
j.p = g
j.s = l
j.q = n
k.z = e
g.t = j
g.y = j
g.q = n
g.o = b
g.w = c
e.z = b
e.p = j
assert f.w.p.p.q.w.w.p.txt == "j"