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

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

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

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

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

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

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

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

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

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

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

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

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

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

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