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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: E = None
        self.w: C = None
        self.r: E = 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.o: C = None
        self.s: B = None
        self.r: C = None
        self.v: B = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

h.s = i
f.t = m
f.o = i
f.y = i
f.r = i
f.w = d
d.v = f
m.o = k
m.s = f
m.r = d
m.y = d
m.v = a
m.u = j
i.o = a
j.q = h
k.v = f
a.t = m
a.o = i
a.y = i
a.r = i
a.w = d
assert h.s.o.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.y: E = None
        self.w: C = None
        self.r: E = 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.o: C = None
        self.s: B = None
        self.r: C = None
        self.v: B = None
        self.u: F = None
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

h.s = i
f.t = m
f.o = i
f.y = i
f.r = i
f.w = d
d.v = f
m.o = k
m.s = f
m.r = d
m.y = d
m.v = a
m.u = j
i.o = a
j.q = h
k.v = f
a.t = m
a.o = i
a.y = i
a.r = i
a.w = d
assert h.s.o.t.y.txt == "d"