class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: D = None
        self.x: G = None
        self.w: C = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: D = None
        self.v: B = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: E = None
        self.y: B = None
        self.p: A = None
        self.txt = txt

m = A("m")
e = B("e")
j = C("j")
a = D("a")
f = E("f")
b = F("b")
d = G("d")

m.t = d
m.x = d
m.v = a
m.u = a
m.w = j
m.p = f
e.v = j
e.s = m
j.w = d
j.y = m
j.o = a
j.v = e
j.t = e
j.q = e
a.r = j
a.o = m
f.o = d
f.p = m
b.r = a
d.o = m
d.p = m
d.r = f
d.y = e
assert b.r.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: D = None
        self.x: G = None
        self.w: C = None
        self.p: E = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: A = None
        self.o: D = None
        self.v: B = None
        self.t: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: E = None
        self.y: B = None
        self.p: A = None
        self.txt = txt

m = A("m")
e = B("e")
j = C("j")
a = D("a")
f = E("f")
b = F("b")
d = G("d")

m.t = d
m.x = d
m.v = a
m.u = a
m.w = j
m.p = f
e.v = j
e.s = m
j.w = d
j.y = m
j.o = a
j.v = e
j.t = e
j.q = e
a.r = j
a.o = m
f.o = d
f.p = m
b.r = a
d.o = m
d.p = m
d.r = f
d.y = e
assert b.r.r.o.txt == "a"