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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.r: A = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: A = None
        self.s: C = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

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

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

f.s = k
f.u = c
h.t = j
h.p = f
h.r = f
h.x = g
h.z = d
a.x = h
a.v = h
a.r = f
a.y = k
a.p = b
g.y = h
g.p = h
g.q = f
g.r = f
g.s = a
j.x = m
j.v = h
m.x = f
d.t = j
d.p = f
d.r = f
d.x = g
d.z = h
k.x = m
k.v = d
b.x = f
c.x = d
c.v = h
c.r = f
c.y = k
c.p = m
assert f.s.x.x.u.r.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: B = None
        self.r: A = None
        self.y: E = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: A = None
        self.s: C = None
        self.p: B = None
        self.r: A = None
        self.txt = txt

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

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

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

f.s = k
f.u = c
h.t = j
h.p = f
h.r = f
h.x = g
h.z = d
a.x = h
a.v = h
a.r = f
a.y = k
a.p = b
g.y = h
g.p = h
g.q = f
g.r = f
g.s = a
j.x = m
j.v = h
m.x = f
d.t = j
d.p = f
d.r = f
d.x = g
d.z = h
k.x = m
k.v = d
b.x = f
c.x = d
c.v = h
c.r = f
c.y = k
c.p = m
assert f.s.x.x.u.r.u.x.txt == "d"