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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: E = None
        self.p: F = None
        self.u: B = None
        self.t: B = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
c = C("c")
i = D("i")
f = E("f")
n = F("n")
k = D("k")
d = B("d")
h = F("h")
l = E("l")

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

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: E = None
        self.p: F = None
        self.u: B = None
        self.t: B = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: F = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

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

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

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

g = A("g")
b = B("b")
c = C("c")
i = D("i")
f = E("f")
n = F("n")
k = D("k")
d = B("d")
h = F("h")
l = E("l")

g.t = c
g.v = k
b.x = i
b.w = i
b.y = f
b.p = h
b.u = d
b.t = d
c.x = g
c.q = h
c.v = d
c.w = d
i.z = k
f.u = d
n.s = b
n.x = c
n.v = f
k.z = i
d.x = i
d.w = i
d.y = l
d.p = n
d.u = b
d.t = b
h.s = d
h.x = c
h.v = f
l.u = d
assert f.u.y.u.p.txt == "n"