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

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

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

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

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

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

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

b.t = i
b.o = i
b.u = m
g.p = m
j.s = b
j.o = b
j.t = i
j.v = f
m.s = d
n.p = f
n.t = m
i.t = g
i.w = d
e.p = j
e.t = m
d.p = f
d.t = m
f.s = b
f.o = b
f.t = i
f.v = j
assert f.t.t.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.o: F = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

b.t = i
b.o = i
b.u = m
g.p = m
j.s = b
j.o = b
j.t = i
j.v = f
m.s = d
n.p = f
n.t = m
i.t = g
i.w = d
e.p = j
e.t = m
d.p = f
d.t = m
f.s = b
f.o = b
f.t = i
f.v = j
assert f.t.t.p.s.p.txt == "f"