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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.v: E = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.y: D = None
        self.txt = txt

j = A("j")
m = B("m")
d = C("d")
b = D("b")
g = E("g")
n = F("n")
i = A("i")
l = F("l")

j.p = b
j.v = b
j.x = d
m.u = l
m.q = b
m.x = d
m.v = g
d.z = i
d.x = l
d.v = g
d.y = j
d.t = m
b.r = d
b.t = d
b.y = m
g.y = i
g.o = j
g.q = n
g.r = d
g.z = m
n.z = b
n.y = b
n.o = d
i.p = b
i.v = b
i.x = d
l.z = b
l.y = b
l.o = d
assert d.z.p.y.q.r.t.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: F = None
        self.v: E = None
        self.y: A = None
        self.t: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: C = None
        self.y: D = None
        self.txt = txt

j = A("j")
m = B("m")
d = C("d")
b = D("b")
g = E("g")
n = F("n")
i = A("i")
l = F("l")

j.p = b
j.v = b
j.x = d
m.u = l
m.q = b
m.x = d
m.v = g
d.z = i
d.x = l
d.v = g
d.y = j
d.t = m
b.r = d
b.t = d
b.y = m
g.y = i
g.o = j
g.q = n
g.r = d
g.z = m
n.z = b
n.y = b
n.o = d
i.p = b
i.v = b
i.x = d
l.z = b
l.y = b
l.o = d
assert d.z.p.y.q.r.t.x.x.txt == "l"