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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.r: E = None
        self.z: E = None
        self.s: B = None
        self.txt = txt

m = A("m")
i = B("i")
j = C("j")
d = D("d")
h = E("h")
k = F("k")
l = B("l")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: B = None
        self.r: E = None
        self.z: E = None
        self.s: B = None
        self.txt = txt

m = A("m")
i = B("i")
j = C("j")
d = D("d")
h = E("h")
k = F("k")
l = B("l")

m.x = i
m.r = k
m.q = d
m.v = d
m.t = h
i.u = d
j.u = d
j.y = d
j.v = l
d.x = h
d.y = h
d.s = i
d.u = i
d.p = j
d.w = k
h.o = m
h.z = l
k.q = d
k.x = l
k.r = h
k.z = h
k.s = i
l.u = d
assert j.v.u.x.o.r.s.u.txt == "d"