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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: F = None
        self.r: A = None
        self.txt = txt

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

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