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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

h.x = k
l.r = n
l.t = h
l.y = k
k.y = j
k.o = j
k.w = h
b.z = h
b.y = m
b.s = m
n.o = l
n.u = d
m.t = d
m.r = d
m.q = d
m.v = n
j.o = d
j.u = l
d.r = n
d.t = h
d.y = k
assert b.s.v.o.y.y.u.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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