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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.x: B = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: A = None
        self.s: F = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: B = None
        self.x: B = None
        self.s: E = None
        self.p: D = None
        self.txt = txt

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

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

d.t = n
d.q = m
d.o = m
d.w = l
d.x = g
d.s = g
m.y = l
m.s = l
m.w = d
m.u = f
n.v = m
g.q = m
g.o = d
g.r = j
j.r = m
j.y = m
j.x = m
j.s = h
j.p = g
l.o = g
l.x = g
l.s = h
f.v = m
h.r = m
h.y = m
h.x = m
h.s = j
h.p = g
assert f.v.u.v.txt == "m"