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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: E = None
        self.s: A = None
        self.v: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: G = None
        self.r: C = None
        self.v: C = None
        self.txt = txt

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

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

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

d.u = m
d.t = b
d.x = h
b.w = c
b.v = c
b.u = h
b.s = d
k.y = h
k.r = h
f.r = b
f.o = d
h.t = c
h.z = c
h.r = k
h.v = k
m.p = k
m.u = k
m.s = k
c.s = h
c.p = h
c.v = h
c.r = d
assert d.x.r.r.t.r.txt == "d"