class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.s: C = None
        self.u: D = None
        self.o: E = None
        self.w: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: A = None
        self.txt = txt

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

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

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